package com.woniu.function.service.impl;

import com.woniu.entity.Result;
import com.woniu.function.mapper.IllegallyMapper;
import com.woniu.function.service.IIllegallyService;
import com.woniu.function.pojo.Illegally;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 车辆违章表 服务实现类
 * </p>
 *
 * @author 何荣卓
 * @since 2023-02-22
 */
@Service
public class IllegallyServiceImpl extends ServiceImpl<IllegallyMapper, Illegally> implements IIllegallyService {
    @Autowired(required = false)
    private IllegallyMapper illegallyMapper;

    @Override
    public Result selectIllegally(String userId, String carId) {
        List<Illegally> illegals = illegallyMapper.selectIllegally(userId,carId);
        if (illegals != null) {
            return Result.ok(illegals);
        }
        return Result.error(500);
    }
}
